'use strict';

const Service = require('egg').Service;

class GetGoodsListService extends Service {
  async getGoodsList() {
    let sql = "SELECT * FROM product_list WHERE classify_id = ?"
    const res = await this.app.mysql.query(sql, ["1003"])
    if (res.length > 0) {
      return {
        code: 200,
        result: res,
        msg: "查询成功"
      }
    }
    return {
      code: 404,
      result: [],
      msg: "查询失败"
    }
  }
}

module.exports = GetGoodsListService;
